﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Entities.Inspections
{
    public class EResultType : ELookupBase
    {
        public EResultType()
            :base()
        {
        }

        public EResultType(Int32 id)
        :this()
        {
            Id = id;
        }

        public EResultType(Int32 id, string name)
            : this(id)
        {
            Name = name;
        }

        public static int ParseValue(string value)
        {
            int numberOne = 0;
            int numberTwo = 0;

            int _commaIndex = value.IndexOf("-");
            if (_commaIndex > -1)
            {
                numberOne = ConvertHelper.ToInt32(value.Split('-')[0]) * 10;
                numberTwo = ConvertHelper.ToInt32(value.Split('-')[1]);
                numberOne = numberOne + numberTwo;
            }
            else
            {
                numberOne = ConvertHelper.ToInt32(value);
            }
            return numberOne;
        }
    }
}
